package com.haohope.framework.wb.buffer;

import java.util.Collection;
import java.util.Map;
import java.util.Set;
import com.haohope.framework.cache.RedisCache;
import com.haohope.framework.redis.FastJsonRedisTemplate;

public class RedisFileBuffer extends _FileBuffer{
	private RedisCache buffer;
	public RedisFileBuffer(FastJsonRedisTemplate redisTemplate) {
		buffer = new RedisCache(redisTemplate,"wb:file");
	}
	@Override
	public int _size() {
		return buffer.size();
	}
	@Override
	public boolean _isEmpty() {
		return buffer.isEmpty();
	}
	@Override
	public boolean _containsKey(String key) {
		return buffer.containsKey(key);
	}
	@Override
	public boolean _containsValue(Object[] value) {
		return buffer.containsValue(value);
	}
	@Override
	public Object[] _get(String key) {
		return (Object[]) buffer.get(key);
	}
	@Override
	public Object[] _put(String key, Object[] value) {
		return (Object[]) buffer.put(key, value);
	}
	@Override
	public Object[] _remove(String key) {
		return (Object[]) buffer.remove(key);
	}
	@Override
	public void _putAll(Map<String, Object[]> m) {
		buffer.putAll(m);
	}
	@Override
	public void _clear() {
		buffer.clear();
	}
	@SuppressWarnings("unchecked")
	@Override
	public Set<String> _keySet() {
		return buffer.keySet();
	}
	@SuppressWarnings("unchecked")
	@Override
	public Collection<Object[]> _values() {
		return buffer.values();
	}
	@SuppressWarnings("unchecked")
	@Override
	public Set<Entry<String, Object[]>> _entrySet() {
		return buffer.entrySet();
	}
}
